package 补充.网络编程;

import java.io.IOException;
import java.net.*;

public class UDP网络编程发送 {
    public static void main(String[] args) throws IOException {
        DatagramSocket socket = new DatagramSocket(8090);
        byte[] buf = new byte[64];
        DatagramPacket packet = new DatagramPacket(buf,0,buf.length, InetAddress.getByName("127.0.0.1"),8081);
        System.out.println("发送数据");
        socket.send(packet);
        socket.close();

    }
}
